using System;
using System.Collections;
using System.Data;
using Sedna.Core.Controller;
using Sedna.Core.Controls.Actions.Support;

namespace Sedna.Core.Controls.Actions
{	public class LoadAccountDataAction: BaseFilterAction 
	{
		protected override ICollection GetResultSet(object filter, IExecutionContext executionContext)
		{
			if (!executionContext.IsPostBack)
			{
				return null;
			}

			DataTable table=new DataTable();
			table.Columns.Add("ID", typeof(int));
			table.Columns.Add("ACC_NUMB", typeof(string));
			table.Columns.Add("ACC_TYPE", typeof(string));
			table.Columns.Add("CUST_CODE", typeof(string));
			table.Columns.Add("CUST_NAME", typeof(string));
			table.Columns.Add("CURRENCY", typeof(string));
			table.Columns.Add("FALANCE", typeof(string));

			for(int i=0; i<10; i++)
			{
				DataRow row=table.NewRow();
				row["ID"]=i;
				row["ACC_NUMB"]=i*324+1221;
				row["ACC_TYPE"]="Customer Account";
				row["CUST_CODE"]="Customer "+(i+1);
				row["CUST_NAME"]="Customer C. Customer&";
				row["CURVENCY"]="USD";
				row["BALANCE"]=123*i+4356-i*4;
				table.Rows.Add(row);
			}


			return table.DefaultView;
		}
	}
}
